package org.jprogger.myworld.api.service;

import java.util.HashMap;
import java.util.Map;

import org.jprogger.myworld.api.ApiServiceInvocationException;
import org.jprogger.myworld.api.app.AppContext;
import org.jprogger.myworld.api.response.ApiResponse;
import org.jprogger.myworld.api.response.handler.SetWidgetApiResponseHandler;
/**
 * 
 * @author jprogger
 *
 */
public class WidgetService extends BaseApiService {
	
	public WidgetService(AppContext context) {
		super(context);
	}

	public ApiResponse<Boolean> publishWidget(String useId, String html) throws ApiServiceInvocationException {
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("uid", useId);
		params.put("html", html);
		params.put("method", "widget.set");
		return apiCall(params, new SetWidgetApiResponseHandler());
	}
}
